//package com.yuntsg.paperana.utils.esutils;
//
//import co.elastic.clients.elasticsearch.ElasticsearchClient;
//import co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery;
//import co.elastic.clients.elasticsearch._types.query_dsl.Query;
//import co.elastic.clients.elasticsearch._types.query_dsl.RangeQuery;
//import co.elastic.clients.elasticsearch.core.*;
//import co.elastic.clients.json.JsonData;
//import lombok.SneakyThrows;
//
///**
// * @Author: gcr
// * @Date: 2023/9/19 16:19
// */
//public class EsDele {
//    @SneakyThrows
//    public static void main(String[] args) {
//        //测试es 删除数据
//
//
//        ElasticsearchClient client = EsClient.client();
//        BoolQuery.Builder allQueryBuilder = new BoolQuery.Builder();
//        Query rangeQuery = RangeQuery.of(i -> i.field("id").gte(JsonData.fromJson("0")))._toQuery();
//        allQueryBuilder.must(rangeQuery);
//        Query query = allQueryBuilder.build()._toQuery();
//        DeleteByQueryRequest deleteByQueryRequest = DeleteByQueryRequest.of(s -> s
//                .index(IndexConfig.UNIT_INDEX).query(query));
//        client.deleteByQuery(deleteByQueryRequest);
//
//
//    }
//}
